import { history } from "umi";
import './index.copy.less'
import React, { useState } from 'react';
import { Button, Modal } from 'antd';

const App: React.FC = () => {
  const [isModalOpen, setIsModalOpen] = useState(false);

  const showModal = () => {
    setIsModalOpen(true);
  };

  const handleOk = () => {
    setIsModalOpen(false);
  };

  const handleCancel = () => {
    setIsModalOpen(false);
  };

  return (
    <div className="demo">
          <h1 onClick={() => history.push('/')}>demo页面 回到index</h1>
      <Button type="primary" onClick={showModal}>
        Open Modal
      </Button>
      <img style={{ width: 200, height: 70 }} src={'demo.png'} alt="" />
      <Modal title="Basic Modal" open={isModalOpen} onOk={handleOk} onCancel={handleCancel}>
        <p>Some contents...</p>
        <p>Some contents...</p>
        <p>Some contents...</p>
      </Modal>
    </div>
  );
};

export default App;
